<?php 
	jimport('joomla.application.component.model');
	class sale_tsc_thu_nganModelthanh_toan extends JModel
	{
        function sp_bill($id_bill)
        {
            $db = &JFactory::getDBO();
            $sql = "select pr.name as pro_name, pr.price, es.id_order as id_buz, es.id as id_bill, od.id_product, od.number, ept.id as id_type,cu.id as id_cu, cu.symbol,od.status, es.id_order as id_buz  
            from #__erp_product pr, #__erp_sale es,#__erp_sale_order od, #__erp_product_type ept, #__erp_financial_currency cu
            where 
            ept.id = pr.id_type_product and
            pr.id = od.id_product
            and es.id = od.id_order
            AND cu.id = pr.id_currency  
            and es.id = '".$id_bill."'
            and es.del =0
            and od.status =3
            ";
			$db->setQuery($sql);
            //print_r($db);die;
            return $db->loadObjectList();	
        }

	}
?>